\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tdsdraft}[2005/01/20]

\newcommand{\tdd@padding}[1]{%
  \ifnum #1<10{0}\fi%
  #1%
}

\newcommand{\timestamp}{%
  % adapted from http://www.tug.org/pipermail/texhax/2002-April/000063.html
  \newcount\tdd@hour%
  \newcount\tdd@minute%
  \tdd@hour=\time%
  \tdd@minute=\time%
  \divide \tdd@hour by 60%
  \divide \tdd@minute by 60%
  \multiply \tdd@minute by 60%
  \tdd@minute=-\tdd@minute%
  \advance \tdd@minute by \time%
  \tdd@padding{\the\tdd@hour}:\tdd@padding{\the\tdd@minute}%
}

%
% Set a draft heading on every page
%
\renewcommand{\@oddhead}{%
   \hskip1cm{\today{} \timestamp}\hfil%
   {\Large\textbf{DRAFT}}\hfil%
   {Do not cite or distribute}\hskip1cm}
\renewcommand{\@evenhead}{\@oddhead}

%
% Create an environment for marking new text
%
%\definecolor{newtextcolor}{rgb}{0.65,0,0}
%\newenvironment{comment}{\color{newtextcolor}}{\normalcolor}
%\newcommand{\comment}{\color{newtextcolor}}
